
# Do not use this file, use make buildext instead.  This file is just
# there if you need to manually compile the extension.  I use it only
# for building for openmoko SHR distribution using openmoko toolchain.

PYTHON_CFLAGS =	-I/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/python2.6

# For some reason I need to not assume strict aliasing (only for the arm version) !
CFLAGS = $(PYTHON_CFLAGS) -L/usr/local/openmoko/arm/usr/lib/ -O3 -fno-strict-aliasing

all: geo.so cobject.so widget.so frame.so painter.so sdl_painter.so surf_widget.so image.so

all_c: geo.c cobject.c widget.c frame.c painter.c sdl_painter.c surf_widget.c image.c

CYTHON = cython

%.so: %.o
	$(CC) -shared $< -I. $(CFLAGS) -o $@
%.o : %.c
	$(CC) -c -fPIC -I. $(CFLAGS) $< -o $@
%.c : %.pyx
	$(CYTHON) -I. -w ../../ tichy/guic/$<

sdl_painter.so: sdl_painter.o
	$(CC) -shared sdl_painter.o `sdl-config --libs` -I. $(CFLAGS) -o sdl_painter.so
sdl_painter.o : sdl_painter.c
	$(CC) -c -fPIC -I.  `sdl-config --cflags` $(CFLAGS) sdl_painter.c -o sdl_painter.o

buildc: all_c

clean:
	rm -f *.o *.c *.so
